import AdminIndex from '@/components/AdminIndex'
import Login from '@/components/Login'
import goodDataGraph from '@/views/goodDataGraph'
import shopDataGraph from '@/views/shopDataGraph'
import shopFileManagement from '@/views/shopFileManagement'
import goodFileManagement from '@/views/goodFileManagement'
import configManage from '@/views/configManage'

import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/admin',
      name: 'AdminIndex',
      component: AdminIndex,
      children: [
        // { // 这里可以写直接访问父路由时渲染哪个component
        //   path: '',
        //   component: Statictis
        // },
        {
          path: 'goodDataGraph',
          name: 'goodDataGraph',
          component: goodDataGraph
        },
        {
          path: 'shopDataGraph',
          name: 'shopDataGraph',
          component: shopDataGraph
        },
        {
          path: 'shopFileManagement',
          name: 'shopFileManagement',
          component: shopFileManagement
        },
        {
          path: 'goodFileManagement',
          name: 'goodFileManagement',
          component: goodFileManagement
        },
        {
          path: 'configManage',
          name: 'configManage',
          component: configManage
        }
      ]
    }
  ]
})
